<?php
namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class UploadController extends Controller
{
    //
    public function upload(Request $request){
    	$file = $request->file('Filedata'); 
    	dd($file);die;
	    if($file->isValid())
	    {
	        // 上传目录。 public目录下 uploads/thumb 文件夹
	        $dir = 'uploads/thumb/';
	  
	        // 文件名。格式：时间戳 + 6位随机数 + 后缀名
	        $filename = time() . mt_rand(100000, 999999) . '.' . $file ->getClientOriginalExtension();
	          
	        $file->move($dir, $filename);
	        $path = $dir . $filename;
	        return url($path);
	    }
	}
}
